set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set (CPACK_SOURCE_GENERATOR "TBZ2;ZIP")
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
set (CPACK_SET_DESTDIR "ON")
set (CPACK_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/cpack/staging")
if (APPLE)
	set(CPACK_GENERATOR "ZIP")
	file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/osx")
	set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist/osx")
endif()
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
